<%@ Page Language="C#" MasterPageFile="~/AdminCP/AdminCP.master" AutoEventWireup="true"
    CodeFile="Products.aspx.cs" Inherits="AdminCP_Products" Title="Untitled Page" ValidateRequest="false" %>

<%@ Register Src="../include/Pager.ascx" TagName="Pager" TagPrefix="uc1" %>
<asp:Content ID="TitleProducts" ContentPlaceHolderID="CphTitle" runat="Server">
    <%=Resources.Lang.admincpProducts %>
</asp:Content>
<asp:Content ID="ContentProducts" ContentPlaceHolderID="CphBody" runat="Server">
    <div id="middle">
        <div id="left-column">
                <%=Resources.Lang.Name%> <asp:TextBox ID="txtSName" runat="server" Width="142px" Height="14px"></asp:TextBox>                                
                <%=Resources.Lang.Manufacturers%> :<asp:DropDownList ID="drpSMan" runat="server" Width="142px"></asp:DropDownList>
                <%=Resources.Lang.admincpCategories%> :<asp:DropDownList ID="drpSCat" runat="server" Width="142px"></asp:DropDownList>                
                <%=Resources.Lang.Visible%> :&nbsp;&nbsp;<br /><asp:DropDownList ID="drpSVisible" runat="server" Width="50px"></asp:DropDownList>
                <%=Resources.Lang.Special%> : <asp:DropDownList ID="drpSSpecial" runat="server" Width="50px"></asp:DropDownList>            
                <br /> <br />
             <div align="center"> 
                <asp:Button ID="btsearch" runat="server" OnClick="btsearch_Click" Height="34px" Width="65px" /></div>
        </div>
        <div id="center-column">
            <div class="top-bar">
                <a class="button" href="Products.aspx?do=add"><%=Resources.Lang.Add %></a>
                <h1>
                    <%=Resources.Lang.admincpProducts %>
                </h1>
            </div>
            <br />
            <br />
            <br />
            <div class="table">
                <img src="AdminImages/bg-th-left.gif" width="8" height="7" alt="" class="left" />
                <img src="AdminImages/bg-th-right.gif" width="7" height="7" alt="" class="right" />
                <table class="listing" cellpadding="0" cellspacing="0">
                    <tr>
                        <th class="first">
                            ID</th>
                        <th>
                            <%=Resources.Lang.Name %>
                        </th>
                        <th>
                            <%=Resources.Lang.Description %>
                        </th>
                        <th>
                            <%=Resources.Lang.Price %>
                        </th>
                        <th>
                            <%=Resources.Lang.Categories %>
                        </th>
                        <th>
                            <%=Resources.Lang.dateAdded %>
                        </th>
                        <th class="last">
                            <%=Resources.Lang.Action %>
                        </th>
                    </tr>
                    <asp:Repeater ID="rptProducts" runat="server">
                        <ItemTemplate>
                            <tr>
                                <td class="first" width="7%">
                                    <%#DataBinder.Eval(Container.DataItem,"ProductID")%>
                                </td>
                                <td width="25%">
                                    <%#DataBinder.Eval(Container.DataItem,"Name")%>
                                </td>
                                <td width="25%">
                                    <%#DataBinder.Eval(Container.DataItem,"Description")%>
                                </td>
                                <td width="10%">
                                    <%#DataBinder.Eval(Container.DataItem,"Price")%>
                                </td>
                                <td width="10%">
                                    <%#Web.Core.Objects.Categories.GetCategoryByID((int)DataBinder.Eval(Container.DataItem,"CategoryID"),(int)Session["Language"]).Name%>
                                </td>
                                <td width="13%">
                                    <%#DataBinder.Eval(Container.DataItem,"DateAdded")%>
                                </td>
                                <td class="last" width="10%">
                                    <a href="Products.aspx?do=edit&pid=<%#DataBinder.Eval(Container.DataItem,"ProductID")%>"><img src="AdminImages/edit-icon.gif" /></a>&nbsp;
                                    <a href="Products.aspx?do=del&pid=<%#DataBinder.Eval(Container.DataItem,"ProductID")%>"><img src="AdminImages/hr.gif" /></a>
                                </td>
                            </tr>
                        </ItemTemplate>
                        <AlternatingItemTemplate>
                            <tr class="bg">
                                <td class="first">
                                    <%#DataBinder.Eval(Container.DataItem,"ProductID")%>
                                </td>
                                <td>
                                    <%#DataBinder.Eval(Container.DataItem,"Name")%>
                                </td>
                                <td>
                                    <%#DataBinder.Eval(Container.DataItem,"Description")%>
                                </td>
                                <td>
                                    <%#DataBinder.Eval(Container.DataItem,"Price")%>
                                </td>
                                <td>
                                    <%#Web.Core.Objects.Categories.GetCategoryByID((int)DataBinder.Eval(Container.DataItem,"CategoryID"),(int)Session["Language"]).Name%>
                                </td>
                                <td>
                                    <%#DataBinder.Eval(Container.DataItem, "DateAdded")%>
                                </td>
                                <td class="last">
                                    <a href="Products.aspx?do=edit&pid=<%#DataBinder.Eval(Container.DataItem,"ProductID")%>"><img src="AdminImages/edit-icon.gif" /></a>&nbsp;
                                    <a href="Products.aspx?do=del&pid=<%#DataBinder.Eval(Container.DataItem,"ProductID")%>"><img src="AdminImages/hr.gif" /></a>
                                </td>
                            </tr>
                        </AlternatingItemTemplate>
                    </asp:Repeater>
                </table>
                <div class="select">
                    <uc1:Pager ID="Pager1" runat="server" />
                </div>
            </div>
            <br />
            <br />
            <asp:PlaceHolder ID="PlaceHolderBottom" runat="server"></asp:PlaceHolder>
        </div>
        <div id="right-column">
            <strong class="h">
                <%=Resources.Lang.admincpInfo %>
            </strong>
            <div class="box">
                <%=Resources.Lang.admincpProductsInfo %>
            </div>
        </div>
    </div>
</asp:Content>
<asp:Content ID="AddEditProductsJsCss" ContentPlaceHolderID="CphScriptCss" runat="Server">
    <script type="text/javascript" src="../Tools/tiny_mce/tiny_mce.js"></script>
    <script type="text/javascript">
	tinyMCE.init({
		// General options
		mode : "textareas",
		theme : "advanced",
		plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",

		// Theme options
		theme_advanced_buttons1 : "newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,formatselect,fontselect,fontsizeselect",
		theme_advanced_buttons2 : "pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,image,code,|,preview,|,forecolor,backcolor",
		theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,|,sub,sup,|,charmap,emotions,iespell,media",
		theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,pagebreak,|,ltr,rtl,|,fullscreen,help",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		theme_advanced_resizing : true,
		
		// Example content CSS (should be your site CSS)
		content_css : "css/content.css",

		// Drop lists for link/image/media/template dialogs
		template_external_list_url : "lists/template_list.js",
		external_link_list_url : "lists/link_list.js",
		external_image_list_url : "lists/image_list.js",
		media_external_list_url : "lists/media_list.js",

		// Replace values for the template plugin
		template_replace_values : {
			username : "Some User",
			staffid : "991234"
		}
	});
    </script>

</asp:Content>
